import request from '@/utils/request'
import { GET_USERINFO } from '../actionsTypes'
export const getUserInfo = () => {
  return async (dispatch) => {
    try {
      const res = await request({
        url: '/user',
        method: 'GET'
      })
      dispatch({ type: GET_USERINFO, payload: res.data })
    } catch (err) {
      console.log(err)
    }
  }
}
